Real-Time Attitude Estimation for Spinning Projectiles by Magnetometer Based on an Adaptive Extended Kalman Filter

The attitude measurement system based on geomagnetic information offers advantages such as small space requirements, fast response times, excellent resistance to high-overload conditions, and cost-effectiveness. However, during the flight process of a high-mobility guided spinning projectile, calculating attitude based on geomagnetic information often leads to non-unique solutions. To address this challenge, this paper proposes the Adaptive Extended Kalman Filter (AEKF) attitude estimation algorithm, based on geomagnetic vector information. Based on the analysis of the short-term attitude motion characteristics of the projectile, the Kalman state system equation and the nonlinear observation equation are established, along with real-time correction of the yaw angle and adaptive updates of parameters. The effectiveness of the algorithm is verified by simulations and experiments, demonstrating its ability to eliminate the dual solution problem inherent in traditional Single-Epoch algorithms. It notably improves the accuracy of pitch and roll angle estimation while providing precise estimates of attitude angular rates. Furthermore, the algorithm effectively mitigates the impact of magnetic disturbances on attitude determination. The proposed method has many potential applications in attitude measurement and navigation using geomagnetic data.


Introduction
Accurately measuring the attitude angles and angular rates of spinning projectiles is a fundamental requirement for effective projectile control.Precise acquisition of the projectile's attitude is vital for the guided ammunition's control system to ensure accurate target engagement [1].On the other hand, determining the attitude enables incorporating a damping circuit into the projectile control system, enhancing its dynamic performance [2,3].Consequently, obtaining accurate attitude measurements of spinning projectiles is of utmost significance for guided ammunition applications.
In order to mitigate the impact of aerodynamic asymmetry, mass eccentricity, and assembly errors on flight stability, most projectiles adopt a high-speed rotating mechanism [4,5].In in-flight environments with high axial velocities and intense overloads, commonly employed MEMS gyroscopes encounter challenges such as saturation, performance degradation, failure subsequent to overloading, difficulty in initial alignment, and so on [6,7].Furthermore, its performance degradation is irreversible, which reduces its ability to provide the accurate data required for the solution process.
In recent years, geomagnetic information has been increasingly used to determine the attitude of spinning projectiles.Attitude measurement systems based on geomagnetism offer advantages such as small space occupation, fast response speed, good anti-high overload performance, no accumulated error over time, low cost, and so on [8,9].Most significantly, the attitude can be determined through geomagnetic vector measurements, even in high overload and dynamic flight environments.Meanwhile, as has been validated, the magnetic disturbance imposed on the measurement of the magnetometer often causes a significant decrease in inclination estimation accuracy [10].
Many effective methods were proposed to solve the problem of real-time attitude estimated by magnetic measurement information.Deng [11] employed the Phase-Locked Loop (PLL) technique to track the phase of the radial magnetometer signal, thus obtaining the roll angle of the flying body.Its estimation accuracy is relatively low, and it cannot acquire pitch and yaw information.The Triaxial Magnetometer Extremum Ratio method [12][13][14] is closely tied to the measurement accuracy of the triaxial magnetometer.Therefore, it is essential to utilize online error correction technology [15,16] to ensure the magnetometer's measurement accuracy, albeit at the cost of increasing system complexity.STFT (short-time Fourier transform) adopts the Fourier transform to estimate angular rate well [17,18], but there is a contradiction between the accuracy and real-time performance of this method in assessing attitude, limiting its application in highly dynamic environments.Differential filtering uses the difference in magnetic measurement signals to obtain angular velocity information [19].However, the error obtained is significant, especially when there is a substantial measurement error in the magnetic signal.The angular rate information is obtained by measuring the time of each zero crossing with a sinusoidal magnetic signal in the zero-crossing detection method [2,20].Unfortunately, the certainty of the data update rate is compromised by the direct correlation: the faster the axial speed, the quicker the data update rate becomes.Roberts [21] utilized the triaxial magnetometer output vector and layout direction vector to ascertain the attitude of the flying body for high-speed rotating flying bodies, such as spinning projectiles, in highly dynamic environments.Ensuring the accuracy of vector observations can be challenging.The dynamics model of the flying body can also be used to determine attitude information [4,10].However, the force and torque applied to spinning projectiles are very complex because of their high speed and varied temperature, making an accurate dynamic model challenging to establish.Kalman filter-based projectile attitude estimation methods [22,23] require combining onboard sensors such as gyroscopes, accelerometers, and magnetometers to determine attitude.In high-overload environments, these algorithms face the inevitable and irreversible issue of performance degradation in sensors such as gyroscopes, and their cost and complexity are also critical concerns.
In this article, the geomagnetic measurement method based on the Extended Kalman Filter (AEKF) is proposed to overcome the limitations of existing methods for the attitude measurement of a spinning projectile.This method eliminates the dual solution problem inherent in traditional Single-Epoch algorithms for attitude angle determination while simultaneously providing attitude angular rate information.Based on the short-term attitude and motion characteristics of the projectile, a quadratic polynomial model for pitch angle and roll angle with respect to time is established.Attitude and its conversion rates are selected as states, and real-time correction of the yaw angle is incorporated to formulate the state system equation.Furthermore, a nonlinear observation equation is established based on the direction cosine attitude transformation relationship of the geomagnetic vector in both the launch and projectile coordinate systems.Experimental results suggest that the proposed method effectively reduces real-time measurement errors in the pitch and roll angles of spinning projectiles and mitigates the impact of magnetic disturbance on attitude determination.

Magnetic Attitude Matrix
For the convenience of analysis, suppose the projectile is in external ballistic flight, and the geomagnetic field vector in the launch coordinate system (called 'f ' system in the following) at the measuring point of the magnetic sensor on the projectile is According to the conversion relationship from the launch coordinate system to the projectile coordinate system (called the 'b' system in the following), the projection of the geomagnetic field vector in the projectile coordinate system satisfies: where C b f is the attitude transformation matrix.The transformation relationship from the launch coordinate system Oxyz to the projectile coordinate system Ox b y b z b follows the Euler angle rotation sequence of 'ψ-θ-γ'.The matrix C b f can be expressed as: where ψ is yaw angle, θ is pitch angle, and γ is roll angle.

Traditional Single-Epoch Attitude Algorithm
According to the analysis above, the rotating ammunition has a high initial and axial rotational angular velocity after being launched from the barrel.In the initial uncontrolled flight phase of the outer ballistic trajectory, the gyro-fixed axis effect caused by the high rotation of the projectile axis makes the direction of the projectile stable in the launch coordinate system.At this stage, the yaw angle ψ of the projectile remains unchanged, approximately zero.Due to the spatial distribution of the main geomagnetic field and geomagnetic anomaly field, there is little change in the scale of tens of kilometers.For shortand medium-range rotating ammunition, the geomagnetic field vector can be regarded as a constant vector during outer ballistic flight, which can be obtained before the ammunition is launched.For long-range ammunition, the geomagnetic field vector at the moving point of the projectile can be calculated in real time from the geomagnetic model based on the three-dimensional position information of the projectile.
Considering that the flight trajectory of the projectile is roughly in the launch plane, the yaw angle of the projectile body can be assumed to be zero.Thus, the attitude transformation matrix (1) can be simplified as: According to the linearization approximation theory of nonlinear system, the three components in the projectile coordinate system can be expressed as: According to the universal equation of the trigonometric function: Then, It can be seen from Equation ( 6) that there is a dual solution problem for the pitch angle.Through the analysis of the equation, it can be concluded that the problem occurs when the value goes through 0. In this case, its physical significance can be explained as the straight line where the longitudinal axis of the projectile passes through the projection of the geomagnetic vector on the emission plane.The results of the roll angle have the same problem as shown in Equation (8).
According to Equations ( 7) and ( 8), the solution of the roll angle is related to the pitch angle.Therefore, accurately determining the sign of the pitch angle is the basis for accurately solving the roll angle.
To address the issue of pitch angle ambiguity, the conventional Single-Epoch attitude determination method relies on the relationship between the angle (ε) formed by the projection of the geomagnetic vector onto the launch plane and the longitudinal axis (Xaxis) of the projectile's coordinate system, along with the initial value of the pitch angle (θ 0 ) and the change in pitch angle (θ).Initially, during the launch phase, the value of the pitch angle is determined by comparing θ 0 and ε.If the initial pitch angle θ 0 ≥ ε, the larger of the two values is selected.During the subsequent flight, as the pitch angle decreases to a value less than ε, the smaller of the two values is chosen, and vice versa.
However, the Single-Epoch attitude determination method relies on current sensor measurements without incorporating historical data, rendering it incapable of making informed decisions regarding the pitch angle's ambiguity based on its motion characteristics.In high-dynamic and adverse operational environments, the high rotational speed of the projectile can introduce considerable noise, leading to erroneous pitch angle determinations.Consequently, incorrect calculations may yield inaccurate roll angle readings, significantly impacting the projectile's spin control.

The Adaptive Extended Kalman Filter (AEKF) Attitude Estimation Algorithm
Due to the inevitable influence of magnetic disturbances on geomagnetic information, the AEKF in this article can prevent the issues of divergence or insufficient accuracy that are commonly encountered in algorithms based on Kalman filtering, such as the EKF.
Based on the continuous smoothness of the projectile's attitude change, assuming that the pitch and roll angles are quadratic polynomials within a short period of time, the pitch and roll angles can be expressed as: where a i , b i , c i (i = θ, γ) are the quadratic, linear, and coefficients of the respective attitude angle changes.
In order to maximize the provision of attitude information by the Adaptive Extended Kalman Filter (AEKF), the correction of the yaw angle's influence on the geomagnetic three components (H f ) in the body coordinate system is performed.The pitch and roll angles, along with their first-and second-order rate derivatives, have been designated as the states of the AEKF.Consequently, the state vector is delineated as follows: where θ is the pitch angle and γ is the roll angle.
The state model of the filter can be derived from Equation ( 9) as presented below: .
with the following definitions: where w εx , w εy , w εz are the noise term of the pitch angle; w ζx , w ζy , w ζz denote the noise term of the roll angle.Suppose w(t) is a zero-mean Gaussian white noise vector.It satisfies the following conditions: E[w(t)] = 0, E[w(t) wT(τ)] = q(t)δ(t − τ), q(t) is the variance intensity matrix of white noise.
According to the discretization theory of a continuous-time linear system, the equivalent discretized form of the continuous state equation is: where Based on the direction cosine attitude transformation relationship of the geomagnetic vector between the launch coordinate system and the projectile body coordinate system, the corresponding filtering measurement model can be deduced.As a result, the discretization equation is formulated as follows: where n k is a Gaussian white noise vector whose average value is zero, independent of noise η k , and satisfies the following conditions: , where R k is the variance matrix of the white noise of the magnetometer.
According to the linearization approximation theory of nonlinear systems, the nonlinear equations are Taylor-expanded around the nominal operating point X k , with higherorder terms neglected and only the linear terms retained.This process yields the filtering equation related to state deviations.Following the Extended Kalman Filter (EKF) methodology, the nonlinear measurement equation is linearized as follows: with the following definitions: Upon transforming the filtering equation pertaining to state deviations, the recursive filtering equation for the nonlinear system using the state X k as the estimator can be derived as follows: The adaptive process is as follows: where λ represents the forgetting factor, 0 < λ < 1.When calculating the predicted state covariance matrix, Equation ( 21) continuously estimates and corrects the covariance matrix of system noise in real time.This reduces the state estimation error, enabling the AEKF attitude estimation process for the spinning projectile.
The initial values X 0 and P 0 of the AEKF filter can be determined using the attitude solution from a Single-Epoch geomagnetic attitude measurement algorithm and launch parameters.The noise covariance matrix Q of the filtering system can be obtained based on prior knowledge of the projectile's motion law.The measurement noise covariance matrix R is estimated and determined based on the compensation accuracy of the magnetic sensor.

Simulation Experiments
Based on the motion characteristics during flight, we made the assumption that the yaw angle of the projectile remains unchanged, approximately zero.The pitch angle gradually decreases due to the influence of gravity, and the roll angle changes rapidly.The roll angle speed follows an exponential decay law and obeys the modified Rouge empirical formula, which is assumed as follows: . γ = ω b x = ω 0 exp −0.4k where ω 0 is the equivalent rotational angular rate of the muzzle of the rotating ammunition, L is the length of the projectile, D is the diameter of the projectile, A is the polar moment of inertia of the projectile, k is the correction coefficient, according to the analysis above, the trajectory is designed as depicted in Figure 1: where ω0 is the equivalent rotational angular rate of the muzzle of the rotating ammunition, L is the length of the projectile, D is the diameter of the projectile, A is the polar moment of inertia of the projectile, k is the correction coefficient, according to the analysis above, the trajectory is designed as depicted in Figure 1: The results using the traditional Single-Epoch algorithm are shown in Figure 2.There is magnetic interference around 40 s.A binary ambiguity issue is presented in the pitch and roll angles obtained by the Single-Epoch attitude method.The results using the traditional Single-Epoch algorithm are shown in Figure 2.There is magnetic interference around 40 s.A binary ambiguity issue is presented in the pitch and roll angles obtained by the Single-Epoch attitude method.The binary ambiguity issue of the traditional method is eliminated by the AEKF attitude algorithm, as depicted in Figure 3.The binary ambiguity issue of the traditional method is eliminated by the AEKF attitude algorithm, as depicted in Figure 3.The comparison between the attitude errors derived from the Single −Epoch, EKF, and AEKF is shown in Figure 4.The standard deviations of roll and pitch angles are presented in Table 1.The comparison between the attitude errors derived from the Single-Epoch, EKF, and AEKF is shown in Figure 4.The standard deviations of roll and pitch angles are presented in Table 1.The comparison between the attitude errors derived from the Single −Epoch, EKF, and AEKF is shown in Figure 4.The standard deviations of roll and pitch angles are presented in Table 1.It can be seen from Figure 4 that the presented method, as compared to the traditional Single-Epoch method and EKF, does not exhibit binary ambiguity issues and offers significantly higher precision.Due to the influence of the aerodynamic force on the trajectory during flight, the yaw angle changed by 0.3 • in the process.However, the algorithm considers historical data during the estimation process, keeping the maximum errors of pitch within 1 • and roll angles within 1.5 • , ensuring the continual validity of estimations.Compared with the error of the angles obtained by the Single-Epoch method, the standard deviation of roll angle error is reduced by four times.Similarly, the pitch angle standard deviation decreases four times throughout the process and 14 times in magnetic disturbance regions.Furthermore, it can be observed that the standard deviation of attitude angle errors obtained from the AEKF algorithm is smaller than that obtained from the EKF algorithm in the entire process and demonstrates superior adaptability compared to EKF, resulting in a twofold improvement in attitude accuracy in regions with magnetic disturbance.The convergence process can be accomplished within 100 milliseconds, showcasing the algorithm's characteristics of high precision and real-time capability.
More importantly, the AEKF can provide the first-order and second-order rate of change for both pitch and roll angles, with the first-order rate represented as the angular rate depicted in Figure 5.The standard deviation of attitude angular rate errors is presented in Table 2.This capability is crucial for controlling the attitude of a spinning projectile but cannot be estimated using conventional methods.
ance.The convergence process can be accomplished within 100 milliseconds, showcasing the algorithm's characteristics of high precision and real-time capability.
More importantly, the AEKF can provide the first-order and second-order rate of change for both pitch and roll angles, with the first-order rate represented as the angular rate depicted in Figure 5.The standard deviation of attitude angular rate errors is presented in Table 2.This capability is crucial for controlling the attitude of a spinning projectile but cannot be estimated using conventional methods.It can be observed that the standard deviation of attitude angular rate errors of the AEKF algorithm is smaller than that obtained from the EKF algorithm in the entire process and decreases three times in magnetic disturbance regions.This demonstrates the effectiveness of the algorithm in estimating angular rates.It can be observed that the standard deviation of attitude angular rate errors of the AEKF algorithm is smaller than that obtained from the EKF algorithm in the entire process and decreases three times in magnetic disturbance This demonstrates the effectiveness of algorithm in estimating angular rates.

Semi-Physical Experiments
In order to test the actual performance of the proposed algorithm based on AEKF, semi-physical experiments were conducted with a magnetic attitude measurement system, which consists of a triaxial magnetometer (HMC1053) produced by Honeywell and an STM32 single-chip microcomputer.The magnetic measurement system was fixed on the three-axis high-precision flight simulation turntable, as shown in Figure 6.

Semi-Physical Experiments
In order to test the actual performance of the proposed algorithm based on AEKF, semi-physical experiments were conducted with a magnetic attitude measurement system, which consists of a triaxial magnetometer (HMC1053) produced by Honeywell and an STM32 single-chip microcomputer.The magnetic measurement system was fixed on the three-axis high-precision flight simulation turntable, as shown in Figure 6.When the turntable rotated according to the set trajectory, the original data of the magnetometer was by the MCU, and the actual attitude was obtained by the high-precision photoelectric encoder to compare the obtained value with the reference.
The estimated attitude by taking the magnetic measurement as the observation data was compared with the actual one to verify the performance of the proposed AEKF in an When the turntable rotated according to the set trajectory, the original data of the magnetometer was collected by the MCU, and the actual attitude was obtained by the high-precision photoelectric encoder to compare the obtained value with the reference.
The estimated attitude by taking the magnetic measurement as the observation data was compared with the actual one to verify the performance of the proposed AEKF in an off-line way.In order to simulate actual flight conditions, the rotating speed of the turntable is gradually accelerated from 0 r/s to 5 r/s in the space of one second, and the roll angle is maintained at a speed of 5 r/s.
At the same time, to verify the dual solution problem, the amplitude of the pitch swing was set from 0 • to 90 • .The pitch angle first varies slowly from 45 • to 90 • .Then it goes back and forth between 0 • and 90 • for 48 s; the whole test time is 50 s; the results are shown in Figures 7-9.When the turntable rotated according to the set trajectory, the original data of the magnetometer was collected by the MCU, and the actual attitude was obtained by the high-precision photoelectric encoder to compare the obtained value with the reference.
The estimated attitude by taking the magnetic measurement as the observation data was compared with the actual one to verify the performance of the proposed AEKF in an off-line way.In order to simulate actual flight conditions, the rotating speed of the turntable is gradually accelerated from 0 r/s to 5 r/s in the space of one second, and the roll angle is maintained at a speed of 5 r/s.
At the same time, to verify the dual solution problem, the amplitude of the pitch swing was set from 0° to 90°.The pitch angle first varies slowly from 45° to 90°.Then it goes back and forth between 0° and 90° for 48 s; the whole test time is 50 s; the results are shown in Figures 7-9.It can be seen from Figure 7 that the results of the semi-physical experiments, similar to simulation experiments, exhibit a binary ambiguity issue in the pitch and roll angles obtained through the Single−Epoch attitude method.However, our proposed approach effectively mitigates this issue.
It can be seen from Figure 8 that there is a significantly reduced standard deviation in attitude angle errors when employing the AEKF algorithm compared to the traditional single-epoch method.Furthermore, the standard deviation is consistently lower than that obtained from the EKF algorithm throughout the entire process.
It can be seen from Figure 9 that the standard deviation of attitude angular rates generated by the AEKF algorithm is smaller than those acquired from the EKF algorithm across the entire process.Notably, the EKF algorithm computes attitude angular rates It can be seen from Figure 7 that the results of the semi-physical experiments, similar to simulation experiments, exhibit a binary ambiguity issue in the pitch and roll angles obtained through the Single-Epoch attitude method.However, our proposed approach effectively mitigates this issue.
It can be seen from Figure 8 that there is a significantly reduced standard deviation in attitude angle errors when employing the AEKF algorithm compared to the traditional Single-Epoch method.Furthermore, the standard deviation is consistently lower than that obtained from the EKF algorithm throughout the entire process.
It can be seen from Figure 9 that the standard deviation of attitude angular rates generated by the AEKF algorithm is smaller than those acquired from the EKF algorithm across the entire process.Notably, the EKF algorithm computes attitude angular rates approximately three times greater than those produced by the AEKF.This result is largely consistent with the simulation findings.

Conclusions
Obtaining accurate attitude measurements of spinning projectiles is of paramount importance for guided ammunition applications.Attitude measurement systems based on geomagnetism have the advantages of small space occupation, fast response speed, good anti-high overload performance, no accumulated error over time, and so on, making them suitable for projectile operation in environments of overload and high-dynamic flight.
In this article, an estimation algorithm based on AEKF to estimate the pitch and roll angle, the corresponding angular rate, and the corresponding angular acceleration by using only magnetic field information provided by a triaxial magnetometer is proposed.This method primarily aims to eliminate the dual solution problem inherent in traditional Single-Epoch algorithms and provides better mitigation against the impact of magnetic disturbance on attitude solutions while simultaneously providing attitude angular rate information.
Experiments suggest that the proposed method can effectively reduce measurement errors, lower the complexity of the algorithm, and enhance the real-time performance of the pitch and roll angles of spinning projectiles.The standard deviation of the pitch angle and the roll angle, compared with the traditional Single-Epoch attitude algorithm, is improved by four times.The standard deviation of the attitude angular rate is significantly improved compared to the EKF.In addition, the proposed method has many potential applications involving attitude measurement and geomagnetic navigation.

Figure 1 .
Figure 1.The trajectory of flight in simulation.

Figure 1 .
Figure 1.The trajectory of flight in simulation.

Figure 1 .
Figure 1.The trajectory of flight in simulation.The results using the traditional Single-Epoch algorithm are shown in Figure2.There is magnetic interference around 40 s.A binary ambiguity issue is presented in the pitch and roll angles obtained by the Single-Epoch attitude method.

Figure 2 .
Figure 2. The binary ambiguity issue of the Single −Epoch attitude algorithm.

Figure 2 .
Figure 2. The binary ambiguity issue of the Single-Epoch attitude algorithm.

Figure 3 .
Figure 3.The simulation results are based on the presented algorithm.

Figure 3 .
Figure 3.The simulation results are based on the presented algorithm.

Figure 3 .
Figure 3.The simulation results are based on the presented algorithm.

Figure 4 .
Figure 4.The Comparison of Attitude Errors between Single Epoch, EKF, and AEKF.

Figure 5 .
Figure 5.The errors of the angular rate.

Figure 5 .
Figure 5.The errors of the angular rate.

Figure 7 .
Figure 7.The experimental results.Figure 7. The experimental results.

Figure 7 .
Figure 7.The experimental results.Figure 7. The experimental results.

Figure 8 .
Figure 8. Errors of attitude angle estimation.Figure 8. Errors of attitude angle estimation.

Figure 8 .
Figure 8. Errors of attitude angle estimation.Figure 8. Errors of attitude angle estimation.

Table 1 .
The standard deviation of attitude angle errors of the Single −Epoch, EKF, and AEKF.
Figure 4.The Comparison of Attitude Errors between Single-Epoch, EKF, and AEKF.

Table 1 .
The standard deviation of attitude angle errors of the Single-Epoch, EKF, and AEKF.

Table 2 .
The standard deviation of attitude angular rate errors of the EKF and AEKF algorithms.

Table 2 .
The standard deviation of attitude angular rate errors of the EKF and AEKF algorithms.